<%= form_for(transaction) do |f| %>
  <% if transaction.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(transaction.errors.count, "error") %> prohibited this transaction from being saved:</h2>

      <ul>
      <% transaction.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="row">
    <div class="col-md-1 col-md-offset-1">
      <%= f.label :customer_id %><br>
    </div>
    <div class="col-md-8">
      <%= f.number_field :customer_id, class: "form-control" %>
    </div>
  </div>
  <br>

  <div class="row">
    <div class="col-md-1 col-md-offset-1">
      <%= f.label :room_id %><br>
    </div>
    <div class="col-md-8">
      <%= collection_select(:transaction, :room_id, Room.all, :id, :label, {:prompt => true}, {class: "question-type form-control"}) %>    </div>
  </div>
  <br>

  <div class="row">
    <div class="col-md-1 col-md-offset-1">
      <%= f.label :status_id %><br>
    </div>
    <div class="col-md-8">
<%= collection_select(:transaction, :status_id, Status.all, :id, :label, {:prompt => true}, {class: "question-type form-control"}) %>    </div>
  </div>
  <br>

  <div class="row">
    <div class="col-md-1 col-md-offset-1">
      <%= f.label :check_in %><br>
    </div>
    <div class="col-md-8">
    <%= f.text_field :check_in, :value => Time.now %>
    </div>
  </div>
  <br>

  <div class="row">
    <div class="col-md-1 col-md-offset-1">
      <%= f.label :time %><br>
    </div>
    <div class="col-md-8">
      <%= f.number_field :time, class: "form-control" %>
    </div>
  </div>
  <br>

  <!-- <div class="row">
    <div class="col-md-1 col-md-offset-1">
    </div>
    <div class="col-md-8">
      <%= f.hidden_field :check_out, :value => Time.zone.now.to_time %>
    </div>
  </div>
  <br> -->

      <%= f.hidden_field :total_price, class: "form-control" %>

  <div class="row">
  <div class="actions">
    <div class="col-md-1 col-md-offset-1">
    <%= f.submit "Save", class: "btn btn-primary" %>
    </div>
    <%= link_to 'Cancel', transactions_path, class: "btn btn-primary" %>
  </div>
</div>
<% end %>
<br>